﻿using System;
using Terraria.ModLoader.IO;

namespace Terraria.ModLoader.Default
{
	// Token: 0x02000305 RID: 773
	internal class MysteryTileInfo
	{
		// Token: 0x06001D68 RID: 7528 RVA: 0x00014D61 File Offset: 0x00012F61
		public MysteryTileInfo(string modName, string name)
		{
			this.modName = modName;
			this.name = name;
			this.frameImportant = false;
			this.frameX = -1;
			this.frameY = -1;
		}

		// Token: 0x06001D69 RID: 7529 RVA: 0x00014D8C File Offset: 0x00012F8C
		public MysteryTileInfo(string modName, string name, short frameX, short frameY)
		{
			this.modName = modName;
			this.name = name;
			this.frameImportant = true;
			this.frameX = frameX;
			this.frameY = frameY;
		}

		// Token: 0x06001D6A RID: 7530 RVA: 0x004392B8 File Offset: 0x004374B8
		public override bool Equals(object obj)
		{
			MysteryTileInfo mysteryTileInfo = obj as MysteryTileInfo;
			return mysteryTileInfo != null && !(this.modName != mysteryTileInfo.modName) && !(this.name != mysteryTileInfo.name) && this.frameImportant == mysteryTileInfo.frameImportant && (!this.frameImportant || (this.frameX == mysteryTileInfo.frameX && this.frameY == mysteryTileInfo.frameY));
		}

		// Token: 0x06001D6B RID: 7531 RVA: 0x00439330 File Offset: 0x00437530
		public override int GetHashCode()
		{
			int num = this.name.GetHashCode() + this.modName.GetHashCode();
			if (this.frameImportant)
			{
				num += (int)(this.frameX + this.frameY);
			}
			return num;
		}

		// Token: 0x06001D6C RID: 7532 RVA: 0x00439370 File Offset: 0x00437570
		public TagCompound Save()
		{
			TagCompound tagCompound = new TagCompound();
			tagCompound["mod"] = this.modName;
			tagCompound["name"] = this.name;
			TagCompound tagCompound2 = tagCompound;
			if (this.frameImportant)
			{
				tagCompound2.Set("frameX", this.frameX);
				tagCompound2.Set("frameY", this.frameY);
			}
			return tagCompound2;
		}

		// Token: 0x040018F7 RID: 6391
		public readonly string modName;

		// Token: 0x040018F8 RID: 6392
		public readonly string name;

		// Token: 0x040018F9 RID: 6393
		public readonly bool frameImportant;

		// Token: 0x040018FA RID: 6394
		public readonly short frameX;

		// Token: 0x040018FB RID: 6395
		public readonly short frameY;
	}
}
